import type { Metadata, Viewport } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import Header from "@/components/layout/Header";
import Footer from "@/components/layout/Footer";
import { AuthProvider } from "@/contexts/AuthContext";


const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "AutoTrade - 专业汽车展示平台",
  description: "专业的汽车进出口贸易平台，提供新车、二手车展示服务，支持多语言，服务全球客户",
  keywords: "汽车展示,汽车贸易,新车,二手车,电动车,汽车品牌,进出口",
  authors: [{ name: "AutoTrade Team" }],
  robots: "index, follow",
  openGraph: {
    title: "AutoTrade - 专业汽车展示平台",
    description: "专业的汽车进出口贸易平台，提供新车、二手车展示服务",
    type: "website",
    locale: "zh_CN",
    alternateLocale: ["en_US", "ja_JP", "ko_KR"],
  },
};

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  maximumScale: 1,
  userScalable: false,
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="zh-CN">
      <head>
        <link rel="icon" href="/favicon.ico" />
        <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
        <meta name="theme-color" content="#2563eb" />
      </head>
      <body className={`${geistSans.variable} ${geistMono.variable} antialiased min-h-screen bg-gray-50 flex flex-col`}>
        <AuthProvider>
          <Header />
          <main className="flex-1">
            {children}
          </main>
          <Footer />
        </AuthProvider>
      </body>
    </html>
  );
}